package com.manage.project.biz.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.manage.framework.aspectj.lang.annotation.Log;
import com.manage.framework.aspectj.lang.enums.BusinessType;
import com.manage.project.biz.domain.BizTujianjiegouzhuanxiangjiancha;
import com.manage.project.biz.service.IBizTujianjiegouzhuanxiangjianchaService;
import com.manage.framework.web.controller.BaseController;
import com.manage.framework.web.domain.AjaxResult;
import com.manage.common.utils.poi.ExcelUtil;
import com.manage.framework.web.page.TableDataInfo;

/**
 土建结构专项检查Controller
 *
 * @author liutao
 *
 */
@RestController
@RequestMapping("/biz/tujianjiegouzhuanxiangjiancha")
public class BizTujianjiegouzhuanxiangjianchaController extends BaseController
{
    @Autowired
    private IBizTujianjiegouzhuanxiangjianchaService bizTujianjiegouzhuanxiangjianchaService;

    /**
     * 查询专项检查列表
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouzhuanxiangjiancha:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizTujianjiegouzhuanxiangjiancha bizTujianjiegouzhuanxiangjiancha)
    {
        startPage();
        List<BizTujianjiegouzhuanxiangjiancha> list = bizTujianjiegouzhuanxiangjianchaService.selectBizTujianjiegouzhuanxiangjianchaList(bizTujianjiegouzhuanxiangjiancha);
        return getDataTable(list);
    }

    /**
     * 导出专项检查列表
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouzhuanxiangjiancha:export')")
    @Log(title = "专项检查", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(BizTujianjiegouzhuanxiangjiancha bizTujianjiegouzhuanxiangjiancha)
    {
        List<BizTujianjiegouzhuanxiangjiancha> list = bizTujianjiegouzhuanxiangjianchaService.selectBizTujianjiegouzhuanxiangjianchaList(bizTujianjiegouzhuanxiangjiancha);
        ExcelUtil<BizTujianjiegouzhuanxiangjiancha> util = new ExcelUtil<BizTujianjiegouzhuanxiangjiancha>(BizTujianjiegouzhuanxiangjiancha.class);
        return util.exportExcel(list, "专项检查数据");
    }

    /**
     * 获取专项检查详细信息
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouzhuanxiangjiancha:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(bizTujianjiegouzhuanxiangjianchaService.selectBizTujianjiegouzhuanxiangjianchaById(id));
    }

    /**
     * 新增专项检查，为什么注释 @PreAuthorize("@ss.hasPermi('biz:tujianjiegouzhuanxiangjiancha:add')")
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouzhuanxiangjiancha:add')")
    @Log(title = "专项检查", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BizTujianjiegouzhuanxiangjiancha bizTujianjiegouzhuanxiangjiancha)
    {

        return toAjax(bizTujianjiegouzhuanxiangjianchaService.insertBizTujianjiegouzhuanxiangjiancha(bizTujianjiegouzhuanxiangjiancha));
    }

    /**
     * 修改专项检查
     */
    @Log(title = "专项检查", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BizTujianjiegouzhuanxiangjiancha bizTujianjiegouzhuanxiangjiancha)
    {
        return toAjax(bizTujianjiegouzhuanxiangjianchaService.updateBizTujianjiegouzhuanxiangjiancha(bizTujianjiegouzhuanxiangjiancha));
    }

    /**
     * 删除专项检查
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouzhuanxiangjiancha:remove')")
    @Log(title = "专项检查", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(bizTujianjiegouzhuanxiangjianchaService.deleteBizTujianjiegouzhuanxiangjianchaByIds(ids));
    }
}
